package Factoria;

public class FactoriaVehiculo implements Factoria{
	
	private double amax,amin,anchura,longitud;
		
	public FactoriaVehiculo(String ti){
		FactoriaLista lista = new FactoriaLista();
		if (!(lista.listaTipoVehiculo().contains(ti))){
			throw new IllegalArgumentException("El vehiculo no existe. Debe ser: "+lista.listaTipoVehiculo());
		}
		double mx = 0.0;
		double mn = 0.0;
		double an = 0.0;
		double lo = 0.0;
		if(ti == "Camion"){
			mx = 0.5;
			mn = -1;
			an = 2.60;
			lo = 12.20;
		}
		if(ti == "Autobus"){
			mx = 0.8;
			mn = -1;
			an = 2.40;
			lo = 15.00;
		}
		if(ti == "Turismo"){
			mx = 2;
			mn = -1;
			an = 1.60;
			lo = 4.00;
		}
		if(ti == "Motocicleta"){
			mx = 1.2;
			mn = -0.4;
			an = 0.70;
			lo = 2.14;
		}
		if(ti == "Ambulancia"){
			mx = 2;
			mn = -2;
			an = 2.60;
			lo = 5.95;
		}
		if(ti == "Tractor"){
			mx = 0.3;
			mn = -0.3;
			an = 2.40;
			lo = 4.7;
		}
		amax = mx;
		amin = mn; 
		anchura = an;
		longitud = lo;
	}
	public double getAmax(){
		return amax;
	}
	public double getAmin(){
		return amin;
	}
	public double getAnchura(){
		return anchura;
	}
	public double getLongitud(){
		return longitud;
	}
}